package com.touchapk.javafx;

import javafx.fxml.FXML;
import javafx.scene.control.Label;



/**
 * @description
 * @author yangkeyun
 * @email coyun@qq.com
 * @date 2016年8月7日
 * @version V1.0
 */
public class DeleteController implements DialogController {

	private MainController mainController;

	public DeleteController() { }

	public DeleteController(MainController mainController) {
		this.mainController = mainController;
	}
	
	
	private String msg;
	

	/**
	 * @return the msg
	 */
	public String getMsg() {
		return msg;
	}

	/**
	 * @param msg the msg to set
	 */
	public void setMsg(String msg) {
		this.msg = msg;
	}

	private FXMLDialog dialog;

	@Override
	public void setDialog(FXMLDialog dialog) {
		this.dialog = dialog;
	}

	@FXML
	private Label label;
	
	@FXML
	public void okFunc() {
		
		this.msg=null;
		
		this.mainController.runCall(true);
		
		this.dialog.close();
		
	}

	
	@FXML
	public void cancelFunc() {
		this.msg=null;
		this.dialog.close();
	}

	/**
	 * Initializes the controller class.
	 */
	@FXML
	// This method is called by the FXMLLoader when initialization is complete
	void initialize() {
		if(!"".equals(this.msg)){
			label.setText(this.msg);
		}
	}
	

	
}
